package cn.tedu.csmall.product.mapper;

import cn.tedu.csmall.product.pojo.entity.Category;
import cn.tedu.csmall.product.pojo.vo.CategoryStandardVO;
import cn.tedu.csmall.product.pojo.vo.CategoryListItemVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface CategoryMapper {
    int insert(Category category);

    int insertBatch(List<Category> categoryList);

    int deleteById(Long id);

    int update(Category category);

    int countByName(String name);

    int countByNameAndNotId(@Param("name")String name,@Param("id")Long id);

    int countByParentId(Long ParentId);

    CategoryStandardVO getStandardById(Long id);

    List<CategoryListItemVO> listByParentId(Long ParentId);
}
